#include "Player.h"

Player::Player()
{
  isVassal = false;
  ai = NULL;
  owner = NULL;
  address = "";
  warFlag = false;
}

void Player::setAdvisor(Advisor* advisor)
{
  ai = advisor;
}

void Player::feedVassal(Player* vassal, int numberOfCards)
{
  army.transfer(numberOfCards, vassal->getArmy());
}

vector<Player*> Player::getVassals()
{
  return vassals;
}

void Player::addVassal(Player* newVassal)
{
  vassals.push_back(newVassal);
}

void Player::setOwner(Player* czar)
{
  owner = czar;
}

bool Player::getIsVassal()
{
  return isVassal;
}

void Player::refillHand()
{
  if(hand.size() <= maxHandSize){
    hand.draw();
    refillHand();
  }
}

Deck* Player::getHand()
{
  return &hand;
}

bool Player::isDead()
{
  if((army.size() == 0 || hand.size() == 0)){
    return true;
  }
  else return false;
}

int Player::handCount(){
  return hand.size();
}
Deck* Player::getArmy(){
  return &army;
}

/* for AI */
int Player::getPlay(){
  
}
int Player::getFeedNumber(Player* vassal){
  return 5;
}
vector<Player*> Player::getFeedVassal()
{
  vector<Player*> tempList;
  for(int i = 0; i < vassals.size() - 1; i++){
    if (vassals.at(i)->army.size() < 6){
      tempList.push_back(vassals.at(i));
    }
  }
  return tempList;
}
void Player::setAddress(string address)
{
}
string Player::getAddress()
{
}
void Player::setMoveCard(Card* card)
{
}
void Player::setMoveFeed(Player* vassal, int numCards)
{
}
int Player::getMoveFeed()
{
}
Card* Player::getMoveCard()
{
}

bool Player::getWarFlag()
{
  return warFlag;
}

void Player::setWarFlag(bool w)
{
  warFlag = w;
}
